<!--
 * @Author: your name
 * @Date: 2022-02-24 14:55:14
 * @LastEditTime: 2022-02-25 08:40:13
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \briup-study\day04\6-水平垂直居中.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6-水平垂直居中</title>
    <style>
        .parent{
            width: 200px;
            height: 200px;
            background-color: #556;
            /* 水平居中垂直方案 */
            display: flex;
            justify-content: center;
            align-items: center;
            
        }
        .child{
            width: 100px;
            height: 100px;
            background-color: #afd;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child"></div>
    </div>
</body>
</html>